<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<!DOCTYPE html>
<html lang=ko>
<head>
<meta charset=UTF-8 />
<meta name=viewport content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1" />
<link rel="shortcut icon" href=assets/ico/favicon.png />
<link rel=apple-touch-icon-precomposed href=assets/ico/apple-touch-icon-57-precomposed.png />
<link rel=apple-touch-icon-precomposed sizes=72x72 href=assets/ico/apple-touch-icon-72-precomposed.png />
<link rel=apple-touch-icon-precomposed sizes=114x114 href=assets/ico/apple-touch-icon-114-precomposed.png />
<link rel=apple-touch-icon-precomposed sizes=144x144 href=assets/ico/apple-touch-icon-144-precomposed.png />
<link rel=stylesheet type=text/css href=assets/css/bootstrap.min.css />
<link rel=stylesheet type=text/css href=assets/css/nanumfont.css />
<!--[if lt IE 9]>
<script type=text/javascript src=assets/js/html5shiv.js></script>
<script type=text/javascript src=assets/js/respond.min.js></script>
<![endif]-->
<!--[if gt IE 9]>
<link rel=stylesheet type=text/css href=assets/css/ie10.css />
<script type=text/javascript src=assets/js/ie10.js></script>
<![endif]-->
<link rel=stylesheet type=text/css href=assets/font-awesome-4.0.3/css/font-awesome.min.css />
<link rel=stylesheet href=http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css>
<title>option</title>
<link rel=stylesheet href=assets/css/option.css>
</head>
<body>
<div class=popup-box>
<p>
현재 설정 값을 <br /> 저장 하시겠습니까?
</p>
<div>
<button id=ok class="btn btn-primary pull-left">확인</button>
<button id=cancel class="btn btn-primary pull-right">취소</button>
</div>
</div>
<nav class="navbar navbar-fixed-top" role=navigation>
<div class="nav_content text-center">
<div class="nav_menu_btn pull-left text-center">
<a class=back_btn onclick=history.back()><i class=icon-arrow-left></i></a>
</div>
<span class=page_title><strong>경로선택</strong></span>
</div>
</nav>
<div class=content>
<h4><strong>알람 On/Off<strong></strong></h4>
<input type=checkbox id=check><label for=check id=set_alarm>알람 사용</label>
<div class=margin-top-50>
<h4><strong>알람 시간 설정</strong></h4>
<fieldset>
<input type=radio id=radio1 name=radio checked=checked><label for=radio1>5분</label>
<input type=radio id=radio2 name=radio><label for=radio2>10분</label>
<input type=radio id=radio3 name=radio><label for=radio3>15분</label>
<input type=radio id=radio4 name=radio><label for=radio4>20분</label>
</fieldset>
</div>
<div>
<h4><strong>알람 거리 설정</strong></h4>
<fieldset>
<input type=radio id=radio5 name=radio2 checked=checked><label for=radio5>30m</label>
<input type=radio id=radio6 name=radio2><label for=radio6>50m</label>
<input type=radio id=radio7 name=radio2><label for=radio7>100m</label>
<input type=radio id=radio8 name=radio2><label for=radio8>150m</label>
</fieldset>
</div>
</div>
<script src=assets/js/jquery.js></script>
<script type=text/javascript src=assets/js/bootstrap.min.js></script>
<script type=text/javascript src=assets/js/string.js></script>
<script src=http://code.jquery.com/ui/1.10.3/jquery-ui.js></script>
<script type=text/javascript>var alarmDB={};alarmDB.webdb={};alarmDB.webdb.db=null;alarmDB.webdb.open=function(){var a=1*1024*1024;alarmDB.webdb.db=openDatabase("alarmDB","1.0","알람DB",a)};alarmDB.webdb.onError=function(a,b){alert("There has been an error: "+b.message)};alarmDB.webdb.onSuccess=function(a,b){};alarmDB.webdb.update=function(b,c){var a=alarmDB.webdb.db;a.transaction(function(d){d.executeSql("update alarmDB set value=? where key=?",[c,b],alarmDB.webdb.onSuccess,alarmDB.webdb.onError)})};alarmDB.webdb.getAllalarmItems=function(b){var a=alarmDB.webdb.db;a.transaction(function(c){c.executeSql("SELECT * FROM alarmDB",[],b,alarmDB.webdb.onError)})};function loadalarmList(a,b){for(var d=0;b.rows.length;d++){if(b.rows.item(d).key=="is_alarm"){if(b.rows.item(d).value=="true"){$('input[type="checkbox"]').attr("checked",false);$("fieldset").attr("disabled",false);$("#set_alarm").html("알람 사용")}else{if(b.rows.item(d).value=="false"){$('input[type="checkbox"]').attr("checked",true);$("fieldset").attr("disabled",true);$("#set_alarm").html("알람 사용 안함")}}}else{if(b.rows.item(d).key=="set_time"){if(b.rows.item(d).value==0){for(var c=0;c<$('input[name="radio"]').length;c++){$('input[name="radio"]')[c].checked=false}}else{if(b.rows.item(d).value==5){$('input[name="radio"]')[0].checked=true}else{if(b.rows.item(d).value==10){$('input[name="radio"]')[1].checked=true}else{if(b.rows.item(d).value==15){$('input[name="radio"]')[2].checked=true}else{if(b.rows.item(d).value==20){$('input[name="radio"]')[3].checked=true}}}}}}else{if(b.rows.item(d).key=="set_dis"){if(b.rows.item(d).value==0){for(var c=0;c<$('input[name="radio2"]').length;c++){$('input[name="radio2"]')[c].checked=false}}else{if(b.rows.item(d).value==30){$('input[name="radio2"]')[0].checked=true}else{if(b.rows.item(d).value==50){$('input[name="radio2"]')[1].checked=true}else{if(b.rows.item(d).value==100){$('input[name="radio2"]')[2].checked=true}else{if(b.rows.item(d).value==150){$('input[name="radio2"]')[3].checked=true}}}}}}}}}}$(function(){alarmDB.webdb.open();alarmDB.webdb.getAllalarmItems(loadalarmList);$(".popup-box").dialog({autoOpen:false,modal:true,resizable:false,draggable:false});$('input[type="checkbox"]').click(function(){if(this.checked){$("fieldset").attr("disabled",true);$("#set_alarm").html("알람 사용 안함");for(var a=0;a<$('input[name="radio"]').length;a++){$('input[name="radio"]')[a].checked=false}for(var a=0;a<$('input[name="radio2"]').length;a++){$('input[name="radio2"]')[a].checked=false}}else{if(!this.checked){$("fieldset").attr("disabled",false);$("#set_alarm").html("알람 사용");$('input[name="radio"]')[0].checked=true;$('input[name="radio2"]')[0].checked=true}}});$("#header-btn2").click(function(){$(".popup-box").dialog("open")});$("#ok").click(function(){if($('input[type="checkbox"]').is(":checked")){alarmDB.webdb.update("is_alarm",false);alarmDB.webdb.update("set_time",0);alarmDB.webdb.update("set_dis",0)}else{if(!$('input[type="checkbox"]').is(":checked")){var c=[5,10,15,20];var a=[30,50,100,150];alarmDB.webdb.update("is_alarm",true);for(var b=0;b<$('input[name="radio"]').length;b++){if($('input[name="radio"]')[b].checked==true){alarmDB.webdb.update("set_time",c[b])}}for(var b=0;b<$('input[name="radio2"]').length;b++){if($('input[name="radio2"]')[b].checked==true){alarmDB.webdb.update("set_dis",a[b])}}}}$(".popup-box").dialog("close")});$("#cancel").click(function(){$(".popup-box").dialog("close")})});</script>
</body>
</html>